<?
include"../inc/config.inc.php";
if($_POST[MODE]=="ADD")
{
$year_id=$_POST[year_id];
$year=$_POST[year];
$sql="insert into year(year_id,year) values('$year_id','$year')";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=year.php'>";
}
if($_GET[MODE]=="DEL")
{
$year_id=$_GET[year_id];
$year=$_GET[year];
$sql="delete from year where year_id='$year_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=year.php'>";
}
if($_POST[MODE]=="EDIT")
{
$year_id=$_POST[year_id];
$year=$_POST[year];
$sql="UPDATE year set year_id='$year_id',year='$year' where year_id='$year_id'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=year.php'>";
}
?>